/*
 * @Description: 
 * @Author: chenjiaxin
 * @Date: 2021-12-21 20:00:06
 * @LastEditTime: 2022-01-04 17:57:29
 * @FilePath: \novel-serve\src\app\config.js
 */
const fs = require("fs");
const path = require("path");
const dotenv = require("dotenv");
dotenv.config();

const PRIVATE_KEY = fs.readFileSync(
  path.resolve(__dirname, "./keys/private.key")
);
const PUBLIC_KEY = fs.readFileSync(
  path.resolve(__dirname, "./keys/public.key")
);

// const mysqlConfig = {
//   APP_HOST: "http://localhost", //线上环境用 http://120.77.151.16
//   APP_PORT: 8002,

//   MYSQL_HOST: "localhost",
//   MYSQL_PORT: 3306,
//   MYSQL_DATABASE: "h5app",
//   MYSQL_ROOT: "root",
//   MYSQL_PASSWORD: "123456", // 线上环境 数据库密码 Woshicjj123
// };

// console.log("====", process.env.MYSQL_HOST);
// module.exports = {
//   ...mysqlConfig,
//   PRIVATE_KEY: PRIVATE_KEY,
//   PUBLIC_KEY: PUBLIC_KEY,
// };

module.exports = {
  APP_HOST,
  APP_PORT,
  MYSQL_HOST,
  MYSQL_PORT,
  MYSQL_DATABASE,
  MYSQL_ROOT,
  MYSQL_PASSWORD,
  EMAIL_ACCOUNT,
  EMAIL_PASS,
} = process.env;

module.exports.PRIVATE_KEY = PRIVATE_KEY;
module.exports.PUBLIC_KEY = PUBLIC_KEY;